-- Path of Building
--
-- Other active skills
-- Skill data (c) Grinding Gear Games
--
local skills, mod, flag, skill = ...

#skill RepeatingShockwave
#flags spell area
	fromItem = true,
#mods

#skill MinionSacrifice
#flags spell area
	fromTree = true,
#mods

#skill AnimateGuardianWeapon
#flags spell minion duration
	fromItem = true,
	minionHasItemSet = true,
	minionUses = {
		["Weapon 1"] = true,
	},
	minionList = {
		"AnimatedWeapon",
	},
	statMap = {
		["active_skill_damage_+%_final"] = {
			mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", nil) }),
		},
		["attack_minimum_added_physical_damage"] = {
			mod("MinionModifier", "LIST", { mod = mod("PhysicalMin", "BASE", nil, 0, KeywordFlag.Attack) }),
		},
		["attack_maximum_added_physical_damage"] = {
			mod("MinionModifier", "LIST", { mod = mod("PhysicalMax", "BASE", nil, 0, KeywordFlag.Attack) }),
		},
		["number_of_animated_weapons_allowed"] = {
			mod("Multiplier:AnimatedWeapon", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true })
		},
	},
#mods

#skill TouchOfFire
#flags spell
	fromItem = true,
	statMap = {
		["display_touch_of_fire"] = {
			flag("FlameTouched", { type = "GlobalEffect", effectType = "Buff" })
		}
	},
#mods

#skill SupportTriggerSpellOnBowAttack Asenath's Chant
	fromItem = true,
#mods

#skill Barkskin
#flags spell
	fromTree = true,
	statMap = {
		["armour_+%_per_barkskin_stack"] = {
			mod("Armour", "INC", nil, 0, 0, { type = "Multiplier", var = "BarkskinStacks", limitVar = "BarkskinMaxStacks" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Barkskin" }),
		},
		["physical_attack_damage_taken_+_per_barkskin_stack"] = {
			mod("PhysicalDamageTakenFromAttacks", "BASE", nil, 0, 0, { type = "Multiplier", var = "BarkskinStacks", limitVar = "BarkskinMaxStacks" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Barkskin" }),
		},
		["chance_to_evade_attacks_+%_final_per_missing_barkskin_stack"] = {
			mod("EvadeChance", "MORE", nil, 0, 0, { type = "Multiplier", var = "MissingBarkskinStacks" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Barkskin" }),
		},
		["max_barkskin_stacks"] = {
			mod("Multiplier:BarkskinMaxStacks", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
			mod("Multiplier:MissingBarkskinStacks", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill BirdAspect
#flags cast duration
	fromItem = true,
	statMap = {
		["chance_to_deal_double_damage_%"] = {
			mod("DoubleDamageChance", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Avian's Might", effectCond = "AviansMightActive" }),
		},
		["minion_chance_to_deal_double_damage_%"] = {
			mod("MinionModifier", "LIST", { mod = mod("DoubleDamageChance", "BASE", nil) }, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Avian's Might", effectCond = "AviansMightActive" }),
		},
		["base_movement_velocity_+%"] = {
			mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Avian's Flight", effectCond = "AviansFlightActive" }),
		},
		["minion_movement_speed_+%"] = {
			mod("MinionModifier", "LIST", { mod = mod("MovementSpeed", "INC", nil) }, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Avian's Flight", effectCond = "AviansFlightActive" }),
		},
	},
#mods

#skill CatAspect
#flags cast duration
	fromItem = true,
	statMap = {
		["skill_buff_grants_critical_strike_chance_+%"] = {
			mod("CritChance", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Cat's Stealth", effectCond = "CatsStealthActive" }),
		},
		["avoid_damage_%"] = {
			mod("AvoidAllDamageFromHitsChance", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Cat's Stealth", effectCond = "CatsStealthActive" }),
		},
		["attack_speed_+%_granted_from_skill"] = {
			mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Cat's Agility", effectCond = "CatsAgilityActive" }),
		},
		["cast_speed_+%_granted_from_skill"] = {
			mod("Speed", "INC", nil, ModFlag.Cast, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Cat's Agility", effectCond = "CatsAgilityActive" }),
		},
	},
#mods

#skill CrabAspect
#flags cast
	fromItem = true,
	statMap = {
		["physical_damage_reduction_%_per_crab_aspect_stack"] = {
			mod("PhysicalDamageReduction", "BASE", nil, 0, 0, { type = "Multiplier", var = "CrabBarrier" }, { type = "GlobalEffect", effectType = "Buff" }),
		},
		["max_crab_aspect_stacks"] = {
			mod("CrabBarriersMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill SpiderAspect
#flags cast duration
	fromItem = true,
	statMap = {
		["base_damage_taken_+%"] = {
			mod("DamageTaken", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff", effectName = "Spider's Web" })
		},
		["spider_aspect_max_web_count"] = {
			mod("Multiplier:SpiderWebApplyStackMax", "BASE", nil),
		},
	},
#baseMod skill("debuff", true)
#baseMod skill("stackCount", 1, { type = "Multiplier", var = "SpiderWebApplyStack", limitVar = "SpiderWebApplyStackMax" })
#mods

#skill SupportBloodMagicUniquePrismGuardian Blood Magic
	fromItem = true,
#mods

#noGem
#skill BloodOffering
#flags spell duration
	fromItem = true,
	statMap = {
		["damage_+%"] = {
			mod("Damage", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
		},
		["blood_offering_%_of_life_to_lose"] = {
			mod("Multiplier:BloodOfferingLifeSacrificed", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }, { type = "PerStat", stat = "LifeUnreserved", actor = "parent" }),
			div = 100,
		},
		["blood_offering_%_of_lost_life_to_regenerate_as_life_per_second"] = {
			mod("LifeRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
			mod("Multiplier:BloodOfferingBaseRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
			div = 100,
		},
		["blood_offering_life_regenerated_+%_final_per_corpse"] = {
			mod("LifeRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }, { type = "Multiplier", var = "BloodOfferingBaseRegen"},  { type = "Multiplier", var = "CorpseConsumedRecently", limit = 5 }),
			mod("LifeRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }, { type = "Multiplier", var = "BloodOfferingBaseRegen"},  { type = "Multiplier", var = "CorpseConsumedRecently", limit = 5, actor="parent" }),
			div = 100,
		},
	},
#baseMod skill("buffMinions", true)
#baseMod skill("buffNotPlayer", true)
#mods

#skill BloodSacramentUnique
#baseMod skill("radius", 5)
#baseMod mod("Multiplier:BloodSacramentMaxStages", "BASE", 33)
#baseMod flag("HasUncancellableReservation", { type = "Condition", var = "BloodSacramentReservationEHP" })
#flags spell area
	fromItem = true,
	initialFunc = function(activeSkill, output)
		if output.LifeReservedPercent >= 100 then
			return
		end
		local lifeReservedPercent = activeSkill.skillData["LifeReservedPercent"] or 3
		local lifeReserved = activeSkill.skillData["LifeReservedBase"] or math.huge
		activeSkill.skillModList:NewMod("Multiplier:ChannelledLifeReservedPercentPerStage", "BASE", lifeReservedPercent, "Blood Sacrament")
		activeSkill.skillModList:NewMod("Multiplier:ChannelledLifeReservedPerStage", "BASE", lifeReserved, "Blood Sacrament")
	end,
	statMap = {
		["flameblast_hundred_times_radius_+_per_1%_life_reserved"] = {
			skill("radiusExtra", nil, { type = "Multiplier", var = "ChannelledLifeReservedPercentPerStage" }),
			div = 100,
		},
		["flameblast_damage_+%_final_per_10_life_reserved"] = {
			mod("Damage", "MORE", nil, ModFlag.Hit, 0, { type = "Multiplier", var = "ChannelledLifeReservedPerStage", div = 10 }),
		},
		["flameblast_ailment_damage_+%_final_per_10_life_reserved"] = {
			mod("Damage", "MORE", nil, ModFlag.Ailment, 0, { type = "Multiplier", var = "ChannelledLifeReservedPerStage", div = 10 }),
		},
	},
#mods

#noGem
#skill BoneArmour
#flags duration spell
	fromTree = true,
	statMap = {
		["quick_guard_damage_absorbed_%"] = {
			mod("GuardAbsorbRate", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Guard", unscalable = true }),
		},
		["quick_guard_damage_absorb_limit"] = {
			mod("GuardAbsorbLimit", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Guard", unscalable = true }),
		},
	},
#baseMod mod("AvoidBleed", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Guard" })
#mods

#skill TriggeredBoneNova
#flags attack projectile
	fromItem = true,
#mods

#skill BrandDetonate
#flags spell area
	fromItem = true,
#mods

#skill ColdAegis
#flags spell
	fromItem = true,
	statMap = {
		["aegis_unique_shield_max_value"] = {
			mod("ColdAegisValue", "MAX", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill UniqueEnchantmentOfInfernoOnCrit
#flags spell area hit
	fromItem = true,
#mods

#skill TriggeredConsecrate Consecrate
#flags spell duration area
	fromItem = true,
#mods

#skill CreateFungalGroundOnKill
#flags duration area
	fromItem = true,
#mods

#skill CorpseWalk
#flags area
	fromItem = true,
#mods

#skill SupportUniqueCosprisMaliceColdSpellsCastOnMeleeCriticalStrike Cospri's Malice
	fromItem = true,
#mods

#skill TriggeredSummonLesserShrine
#flags spell duration
	fromItem = true,
#mods

#noGem
#skill ChaosDegenAuraUnique
#flags spell aura area
	fromItem = true,
#baseMod skill("dotIsArea", true)
#baseMod skill("radius", 30)
#mods

#skill DeathWalk
#flags cast area
	fromItem = true,
#baseMod skill("explodeCorpse", true)
#baseMod skill("showAverage", true)
#mods

#skill DeathWish
#flags spell area
	fromItem = true,
	parts = {
		{
			name = "Channelling",
			spell = true,
			cast = false,
		},
		{
			name = "Minion Explosion",
			spell = false,
			cast = true,
			stages = true,
		},
	},
	preDamageFunc = function(activeSkill, output)
		if activeSkill.skillPart == 2 then
			local skillData = activeSkill.skillData
			skillData.FireBonusMin = output.Life * skillData.selfFireExplosionLifeMultiplier
			skillData.FireBonusMax = output.Life * skillData.selfFireExplosionLifeMultiplier
		end
	end,
	statMap = {
		["spell_minimum_base_fire_damage"] = {
			skill("FireMin", nil, { type = "SkillPart", skillPart = 2 }),
		},
		["spell_maximum_base_fire_damage"] = {
			skill("FireMax", nil, { type = "SkillPart", skillPart = 2 }),
		},
		["death_wish_attack_speed_+%"] = {
			mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "GlobalEffect", effectType = "Buff" }),
		},
		["death_wish_cast_speed_+%"] = {
			mod("Speed", "INC", nil, ModFlag.Cast, 0, { type = "GlobalEffect", effectType = "Buff" }),
		},
		["death_wish_movement_speed_+%"] = {
			mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
		},
		["death_wish_hit_and_ailment_damage_+%_final_per_stage"] = {
			mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "Multiplier", var = "DeathWishStage" }, { type = "SkillPart", skillPart = 2 }),
		},
		["death_wish_max_stages"] = {
			mod("Multiplier:DeathWishMaxStages", "BASE", nil, 0, 0, { type = "SkillPart", skillPart = 2 }),
		},
	},
	#baseMod skill("explodeCorpse", true, { type = "SkillPart", skillPart = 2 })
	#baseMod skill("radius", 10, { type = "SkillPart", skillPart = 2 })
	#baseMod skill("buffMinions", true)
	#baseMod skill("buffNotPlayer", true)
#mods

#skill Melee Default Attack
#flags attack melee projectile
#mods

#skill MeleeUseContactPoint Default Attack
#flags attack melee projectile
#mods

#skill GemDetonateMines
#flags spell
#mods

#noGem
#skill TouchOfGod
#flags attack area melee
	fromItem = true,
#mods

#skill ElementalAegis
#flags spell
	fromItem = true,
	statMap = {
		["aegis_unique_shield_max_value"] = {
			mod("ElementalAegisValue", "MAX", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill SupportElementalPenetration Elemental Penetration
	fromItem = true,
#mods

#skill OnHitWhileCursedTriggeredCurseNova
#flags spell projectile duration
	fromItem = true,
	parts = {
		{
			name = "Convert to fire",
		},
		{
			name = "Convert to cold",
		},
		{
			name = "Convert to lightning",
		},
	},
	#baseMod mod("SkillPhysicalDamageConvertToFire", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 1 })
	#baseMod mod("SkillPhysicalDamageConvertToCold", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 2 })
	#baseMod mod("SkillPhysicalDamageConvertToLightning", "BASE", 100, 0, 0, { type = "SkillPart", skillPart = 3 })
#mods

#skill EmbraceMadness
#flags spell
	fromItem = true,
#mods

#noGem
#skill Envy
#flags spell aura area
	fromItem = true,
	statMap = {
		["attack_minimum_added_chaos_damage"] = {
			mod("ChaosMin", "BASE", nil, 0, KeywordFlag.Attack, { type = "GlobalEffect", effectType = "Aura" }),
		},
		["attack_maximum_added_chaos_damage"] = {
			mod("ChaosMax", "BASE", nil, 0, KeywordFlag.Attack, { type = "GlobalEffect", effectType = "Aura" }),
		},
		["spell_minimum_added_chaos_damage"] = {
			mod("ChaosMin", "BASE", nil, 0, KeywordFlag.Spell, { type = "GlobalEffect", effectType = "Aura" }),
		},
		["spell_maximum_added_chaos_damage"] = {
			mod("ChaosMax", "BASE", nil, 0, KeywordFlag.Spell, { type = "GlobalEffect", effectType = "Aura" }),
		},
	},
#baseMod skill("radius", 40)
#mods

#skill FireAegis
#flags spell
	fromItem = true,
	statMap = {
		["aegis_unique_shield_max_value"] = {
			mod("FireAegisValue", "MAX", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill FireBurstOnHit
#flags spell area
	fromItem = true,
#baseMod skill("radius", 24)
#mods

#skill FieryImpactHeistMaceImplicit
#flags attack area melee
	fromItem = true,
#mods

#skill AtziriUniqueStaffFlameblast
#flags spell area
	fromItem = true,
#baseMod skill("triggerSource", "Queen's Demand")
#mods

#skill Focus
#mods

#skill SupportTriggerSpellFromHelmet Focus
	fromItem = true,
#mods

#skill CreateSmokeCloud
#flags spell
	fromItem = true,
#mods

#noGem
#skill VaalAuraElementalDamageHealing
#flags spell aura area duration
	fromItem = true,
	statMap = {
		["immune_to_curses"] = {
			--Display Only
		},
	},
#baseMod skill("radius", 40)
#baseMod mod("AvoidCurse", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true })
#mods

#skill GoreShockwave
#flags attack area melee
	fromItem = true,
#mods

#skill SupportGreaterSpellEcho Greater Spell Echo
	fromItem = true,
	statMap = {
		["support_greater_spell_echo_spell_damage_+%_final_per_repeat"] = {
			mod("RepeatPerRepeatDamage", "MORE", nil, 0, 0, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
		},
		["support_greater_spell_echo_area_of_effect_+%_per_repeat"] = {
			mod("RepeatPerRepeatAreaOfEffect", "INC", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
		},
	},
#baseMod flag("Condition:HaveGreaterSpellEcho")
#mods

#skill IcestormUniqueStaff12
#flags spell area duration
	fromItem = true,
	statMap = {
		["skill_effect_duration_per_100_int"] = {
			mod("Duration", "BASE", nil, 0, 0, { type = "PerStat", stat = "Int", div = 100 }),
			div = 1000,
		},
	},
#baseMod skill("radiusSecondary", 22)
#baseMod skill("radiusLabel", "Ice projectile:")
#baseMod skill("radiusSecondaryLabel", "Target area:")
#mods

#skill TriggeredIcicleNova
#flags attack projectile
#baseMod skill("showAverage", true)
	fromItem = true,
#mods

#skill MerveilWarp
#flags spell area duration
	fromItem = true,
#mods

#skill CatsStealthTriggeredIntimidatingCry
#flags warcry area duration
	fromItem = true,
	statMap = {
		["skill_empowers_next_x_melee_attacks"] = {
			mod("IntimidatingExertedAttacks", "BASE", nil),
		},
		["intimidating_cry_enemy_phys_reduction_%_penalty_vs_hit_per_5_MP"] = {
			mod("IntimidatingPDRPer5MP", "BASE", nil),
		},
	},
#baseMod skill("radius", 60)
#mods

#skill SupportCastOnManaSpent Kitava's Thirst
	fromItem = true,
#mods

#skill LightningAegis
#flags spell
	fromItem = true,
	statMap = {
		["aegis_unique_shield_max_value"] = {
			mod("LightningAegisValue", "MAX", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill LightningSpell
#flags spell area
	fromItem = true,
	preDamageFunc = function(activeSkill, output)
		activeSkill.skillData.hitTimeOverride = output.Cooldown
	end,
#mods

#skill SupportTriggerBowSkillOnBowAttack Maloney's Mechanism
	fromItem = true,
#mods

#skill UniqueAnimateWeapon
#flags spell minion
	fromItem = true,
	minionList = {
		"UniqueAnimatedWeapon",
	},
	minionUses = {
		["Weapon 1"] = true,
	},
	statMap = {
		["attack_damage_+%"] = {
			mod("MinionModifier", "LIST", { mod = mod("Damage", "INC", nil, ModFlag.Attack) }),
		},
		["attack_speed_+%"] = {
			mod("MinionModifier", "LIST", { mod = mod("Speed", "INC", nil, ModFlag.Attack) }),
		},
	},
#baseMod mod("DisableWeapons", "FLAG", true, 0, 0, { type = "GlobalEffect", effectType = "Buff" })
#baseMod mod("Condition:Onslaught", "FLAG", true, 0, 0, { type = "GlobalEffect", effectType = "Buff" })
#baseMod skill("minionLevel", 65)
#mods

#skill SupportUniqueMjolnerLightningSpellsCastOnHit Mjolner
	fromItem = true,
#mods

#skill TriggeredMoltenStrike
#flags attack projectile area
	fromItem = true,
#baseMod flag("CannotSplit")
#mods

#skill PenanceMark
#flags spell curse duration mark
	fromTree = true,
#baseMod skill("debuff", true)
#mods

#skill PhysicalAegis
#flags spell
	fromItem = true,
	statMap = {
		["aegis_unique_shield_max_value"] = {
			mod("PhysicalAegisValue", "MAX", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
		},
	},
#mods

#skill SupportTriggerSpellOnAttack Poet's Pen
	fromItem = true,
#mods

#skill Portal
#flags spell
#mods

#skill QueensDemand
	fromItem = true,
#mods

#skill PrimalAegis
	fromTree = true,
#mods

#skill Quieten
#flags spell curse area duration hex
	fromTree = true,
#baseMod skill("debuff", true)
#mods

#skill Ravenous
#flags spell
	fromTree = true,
	statMap = {
		["ravenous_buff_magnitude"] = {
			{
				mod("DamageTaken", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectCond = "RavenousCorpseConsumed" }),
				mult = -1,
			},
			{
				mod("Damage", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectCond = "RavenousCorpseConsumed" }),
			},
		},
	},
#mods

#skill TriggeredSummonSpider
#flags spell minion duration
	fromItem = true,
	minionList = {
		"SpiderMinion",
	},
	statMap = {
		["summoned_spider_grants_attack_speed_+%"] = {
			mod("Speed", "INC", nil, ModFlag.Attack, 0, { type = "Multiplier", var = "RaisedSpider" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Raised Spider" }),
		},
		["summoned_spider_grants_poison_damage_+%"] = {
			mod("Damage", "INC", nil, 0, KeywordFlag.Poison, { type = "Multiplier", var = "RaisedSpider" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Raised Spider" }),
		},
	},
#mods

#skill UniqueMirageWarriors
#flags spell duration minion
	fromItem = true,
	statMap = {
		["skill_used_by_mirage_warrior_damage_+%_final"] = {
			mod("SaviourMirageWarriorLessDamage", "BASE", nil),
		},
		["maximum_number_of_mirage_warriors"] = {
			mod("SaviourMirageWarriorMaxCount", "BASE", nil),
		},
	},
#mods

#skill ShadeForm
#flags spell duration
	fromItem = true,
#mods

#skill ShieldShatter
#flags spell area
	fromItem = true,
	statMap = {
		["spell_minimum_base_physical_damage_per_shield_quality"] = {
			skill("PhysicalMin", nil, { type = "Multiplier", var = "QualityOnWeapon 2" }),
		},
		["spell_maximum_base_physical_damage_per_shield_quality"] = {
			skill("PhysicalMax", nil, { type = "Multiplier", var = "QualityOnWeapon 2" }),
		},
		["buff_added_spell_minimum_base_physical_damage_per_shield_quality"] = {
			mod("PhysicalMin", "BASE", nil, ModFlag.Spell, 0, { type = "Multiplier", var = "QualityOnWeapon 2" }, { type = "Condition", var = "BlockedRecently"}, { type = "GlobalEffect", effectType = "Buff"}),
		},
		["buff_added_spell_maximum_base_physical_damage_per_shield_quality"] = {
			mod("PhysicalMax", "BASE", nil, ModFlag.Spell, 0, { type = "Multiplier", var = "QualityOnWeapon 2" }, { type = "Condition", var = "BlockedRecently"}, { type = "GlobalEffect", effectType = "Buff"}),
		},
	},
#baseMod skill("showAverage", true)
#mods

#skill TriggeredShockedGround
#flags spell area duration
	fromItem = true,
#baseMod mod("ShockedGroundEffect", "BASE", 15)
#mods

#skill SummonEssenceSpirits
#flags spell minion
	fromItem = true,
	minionList = {
		"SummonedEssenceSpirit",
	},
#mods

#skill SpiritBurst
#flags spell projectile
	fromItem = true,
#baseMod skill("showAverage", true)
#mods

#skill VolatileDeadChaos
#flags spell
	fromItem = true,
	statMap = {
		["volatile_dead_core_explosion_radius_+"] = {
			skill("radius", "BASE", nil),
		},
	},
#baseMod skill("radiusLabel", "Orb explosion:")
#baseMod skill("radiusSecondaryLabel", "Corpse explosion:")
#mods

#skill StormCascadeTriggered
#flags spell area
	fromItem = true,
#mods

#skill AtziriUniqueStaffStormCall
#flags spell area
	fromItem = true,
#baseMod skill("triggerSource", "Queen's Demand")
#mods

#skill SummonArbalists
#flags spell minion
	fromItem = true,
	minionList = {
		"SummonedArbalists",
	},
#mods

#skill SummonBeastialRhoa
#flags spell minion
	fromItem = true,
	minionList = {
		"RhoaUniqueSummoned",
	},
	statMap = {
		["base_number_of_beast_minions_allowed"] = {
			mod("ActiveBeastMinionLimit", "BASE", nil),
		},
	},
#baseMod skill("allowTotemBuff", true)
#baseMod flag("Condition:HaveBestialMinion", { type = "GlobalEffect", effectType = "Buff" })
#mods

#skill SummonBeastialSnake
#flags spell minion
	fromItem = true,
	minionList = {
		"SnakeSpitUniqueSummoned",
	},
	statMap = {
		["base_number_of_beast_minions_allowed"] = {
			mod("ActiveBeastMinionLimit", "BASE", nil),
		},
	},
#baseMod skill("allowTotemBuff", true)
#baseMod flag("Condition:HaveBestialMinion", { type = "GlobalEffect", effectType = "Buff" })
#mods

#skill SummonBeastialUrsa
#flags spell minion
	fromItem = true,
	minionList = {
		"DropBearUniqueSummoned",
	},
	statMap = {
		["base_number_of_beast_minions_allowed"] = {
			mod("ActiveBeastMinionLimit", "BASE", nil),
		},
	},
#baseMod skill("allowTotemBuff", true)
#baseMod flag("Condition:HaveBestialMinion", { type = "GlobalEffect", effectType = "Buff" })
#mods

#skill CursePillar
#flags duration
	fromItem = true,
#mods

#skill SupportCursePillarTriggerCurses Doedre's Effigy
	fromItem = true,
#baseMod skill("manaReservationPercent", 0)
#mods

#skill SummonGuardianRelic
#flags spell minion duration
	fromTree = true,
	minionList = {
		"GuardianRelicAll",
	},
	statMap = {
		["minion_actor_level_is_user_level_up_to_maximum"] = {
			skill("minionLevelIsPlayerLevel", true),
		},
	},
#mods

#skill SummonHarbingerOfTheArcaneUber
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfBrutalityUber
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfDirectionsUber
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfFocusUber
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfStormsUber
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfTimeUber
#flags spell minion
	fromItem = true,
#baseMod mod("ActionSpeed", "INC", 10, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Greater Harbinger of Time", modCond = "GreaterHarbingerOfTime" })
#baseMod skill("buffAllies", true)
#mods

#skill SummonHarbingerOfTheArcane
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfBrutality
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfDirections
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfFocus
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfStorms
#flags spell minion
	fromItem = true,
#mods

#skill SummonHarbingerOfTime
#flags spell minion
	fromItem = true,
#baseMod mod("ActionSpeed", "INC", 10, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Harbinger of Time", modCond = "HarbingerOfTime" })
#baseMod skill("buffAllies", true)
#mods

#skill TriggeredSummonGhostOnKill Triggered Summon Phantasm
#flags spell minion
	fromItem = true,
	minionList = {
		"SummonedPhantasm",
	},
	statMap = {
		["base_number_of_support_ghosts_allowed"] = {
			mod("ActivePhantasmLimit", "BASE", nil),
		},
	},
#mods

#skill SummonRadiantSentinel
#flags spell minion duration
	fromTree = true,
	minionList = {
		"GuardianSentinel",
	},
	statMap = {
		["radiant_sentinel_minion_fire_%_of_life_to_deal_nearby_per_minute"] = {
			mod("MinionModifier", "LIST", { mod = mod("Multiplier:GuardianSentinelFireAuraBaseDamage", "BASE", nil) }),
			div = 60,
			mod("ExtraMinionSkill", "LIST", { skillId = "GuardianSentinelFireAura" }),
		},
		["radiant_sentinel_minion_burning_effect_radius"] = {
			mod("MinionModifier", "LIST", { mod = mod("Multiplier:GuardianSentinelFireAuraRadius", "BASE", nil) }),
		},
		["minion_actor_level_is_user_level_up_to_maximum"] = {
			skill("minionLevelIsPlayerLevel", true),
		},
	},
#mods

#skill SummonRigwaldsPack
#flags spell minion duration
	fromItem = true,
	minionList = {
		"SummonedSpectralWolf",
	},
	statMap = {
		["spectral_wolf_grants_attack_minimum_added_physical_damage"] = {
			mod("PhysicalMin", "BASE", nil, 0, KeywordFlag.Attack, { type = "Multiplier", var = "SpectralWolfCount" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Spectral Wolf" }),
		},
		["spectral_wolf_grants_attack_maximum_added_physical_damage"] = {
			mod("PhysicalMax", "BASE", nil, 0, KeywordFlag.Attack, { type = "Multiplier", var = "SpectralWolfCount" }, { type = "GlobalEffect", effectType = "Buff", effectName = "Spectral Wolf" }),
		},
		["modifiers_to_claw_critical_strike_chance_apply_minion_critical_strike_chance"] = {
			flag("ClawCritChanceAppliesToMinions"),
		},
		["modifiers_to_claw_critical_strike_multiplier_apply_minion_critical_strike_multiplier"] = {
			flag("ClawCritMultiplierAppliesToMinions"),
		},
	},
#mods

#skill SummonTauntingContraption
#flags spell minion duration
	fromItem = true,
#mods

#skill SummonVoidSphere Summon Volatile Anomaly
#flags spell area duration
	fromItem = true,
#baseMod skill("dotIsArea", true)
#mods

#skill SummonMirageChieftain
#flags spell duration
	fromTree = true,
	statMap = {
		["skill_used_by_mirage_chieftain_damage_+%_final"] = {
			mod("ChieftainMirageChieftainMoreDamage", "BASE", nil),
		},
	},
#mods

#skill TentacleSmash
#flags attack area
	fromItem = true,
#mods

#skill VampiricIcon
#flags spell
	fromItem = true,
	statMap = {
		["vampiric_icon_max_bleeding_beam_targets"] = {
			mod("Multiplier:ThirstForBloodMaxTargets", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true })
		},
		["skill_life_regeneration_per_minute_per_affected_enemy"] = {
			mod("LifeRegen", "BASE", nil, 0, 0, { type = "Multiplier", var = "NearbyBleedingEnemies", limitVar = "ThirstForBloodMaxTargets" }, { type = "GlobalEffect", effectType = "Buff" }),
			div = 60,
		},
		["vampiric_icon_bleeding_damage_+%_final"] = {
			mod("Damage", "MORE", nil, 0, KeywordFlag.Bleed, { type = "GlobalEffect", effectType = "Buff" }),
		},
	},
#mods

#skill SupportTriggerSpellOnSkillUse Trigger Craft
	fromItem = true,
#mods

#skill AvianTornado
#flags spell projectile duration
	fromItem = true,
#baseMod skill("showAverage", true)
#mods

#skill Unhinge
#flags spell
	fromItem = true,
#mods

#skill HiddenBlade
#flags attack projectile forceMainHand
	fromItem = true,
#mods

#skill VaalBreach
#flags spell
#mods

#skill VoidGaze
#flags spell duration
	fromItem = true,
	statMap = {
		["base_chaos_damage_resistance_%"] = {
			mod("ChaosResist", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Debuff" }),
		},
	},
#mods

#skill VoidShot
#flags attack projectile area
	fromItem = true,
#mods

#skill SupportUniqueCastCurseOnCurse Vixen's Entrapment
#flags spell curse
	fromItem = true,
#mods

skills["EnemyExplode"] = {
	name = "On Kill Monster Explosion",
	hidden = true,
	color = 4,
	skillTypes = { [SkillType.Damage] = true, [SkillType.Area] = true },
	castTime = 0,
	parts = {
		{
			name = "This Source Only",
		},
		{
			name = "This Source Only, Ignoring Chance",
		},
		{
			name = "Average Of All Sources",
		},
	},
	preDamageFunc = function(activeSkill, output)
		output.ExplodeChance = 0
		if activeSkill.skillPart ~= 3 then
			local allExplodeMods = activeSkill.skillModList:Tabulate("LIST", activeSkill.skillCfg, "ExplodeMod")
			for _, explodeMod in ipairs(allExplodeMods) do
				local activeEffectSource = activeSkill.activeEffect.srcInstance.explodeSource.modSource or "Tree:"..activeSkill.activeEffect.srcInstance.explodeSource.id
				if explodeMod.mod.source == activeEffectSource then
					local explodeMod = explodeMod.value
					if explodeMod.type == "RandomElement" then
						activeSkill.skillData["FireEffectiveExplodePercentage"] = explodeMod.amount / 3
						activeSkill.skillData["ColdEffectiveExplodePercentage"] = explodeMod.amount / 3
						activeSkill.skillData["LightningEffectiveExplodePercentage"] = explodeMod.amount / 3
					else
						activeSkill.skillData[explodeMod.type.."EffectiveExplodePercentage"] = explodeMod.amount
					end
					output.ExplodeChance = activeSkill.skillPart == 2 and 1 or explodeMod.chance
				end
			end
		else
			local typeAmountChances = { }
			local explodeModList = activeSkill.skillModList:List(activeSkill.skillCfg, "ExplodeMod")
			for _, explodeMod in ipairs(explodeModList) do
				local amountChance = typeAmountChances[explodeMod.type] or {}
				amountChance[explodeMod.amount] = (amountChance[explodeMod.amount] or 0) + explodeMod.chance
				typeAmountChances[explodeMod.type] = amountChance
			end
			for type, amountChance in pairs(typeAmountChances) do
				local physExplodeChance = 0
				for amount, chance in pairs(amountChance) do
					local amountXChance = amount * chance
					if type == "RandomElement" then
						activeSkill.skillData["FireEffectiveExplodePercentage"] = (activeSkill.skillData["FireEffectiveExplodePercentage"] or 0) + amountXChance / 3
						activeSkill.skillData["ColdEffectiveExplodePercentage"] = (activeSkill.skillData["ColdEffectiveExplodePercentage"] or 0) + amountXChance / 3
						activeSkill.skillData["LightningEffectiveExplodePercentage"] = (activeSkill.skillData["LightningEffectiveExplodePercentage"] or 0) + amountXChance / 3
					else
						activeSkill.skillData[type.."EffectiveExplodePercentage"] = (activeSkill.skillData[type.."EffectiveExplodePercentage"] or 0) + amountXChance
					end
					if type == "Physical" then
						physExplodeChance = 1 - ((1 - physExplodeChance) * (1 - chance))
					end
					output.ExplodeChance = 1 - ((1 - output.ExplodeChance) * (1 - chance))
				end
				if type == "Physical" and physExplodeChance ~= 0 then
					activeSkill.skillModList:NewMod("CalcArmourAsThoughDealing", "MORE", 100 / math.min(physExplodeChance, 1) - 100)
				end
			end
		end
		output.ExplodeChance = math.min(output.ExplodeChance * 100, 100)
	end,
	baseMods = {
		skill("radius", 22),
		skill("showAverage", true),
		skill("explodeCorpse", true),
		skill("corpseExplosionLifeMultiplier", 0),
		skill("hitChanceIsExplodeChance", true, { type = "SkillPart", skillPart = 1 }),
	},
	baseFlags = {
		area = true,
		monsterExplode = true
	},
	stats = {
		"is_area_damage",
		"base_skill_show_average_damage_instead_of_dps",
		"display_skill_deals_secondary_damage",
		"damage_cannot_be_reflected",
		"skill_can_add_multiple_charges_per_action",
	},
	levels = {
		[1] = { damageEffectiveness = 0, baseMultiplier = 1, levelRequirement = 1, }
	}
}
